import { Component, NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DevicemComponent } from './device.m';
import { DeviceComponent } from './device/device.component';
import { AddDeviceComponent } from './device/add-device/add-device.component';
import { EditDeviceComponent } from './device/edit-device/edit-device.component';
import { CanActivateGuard } from 'src/app/@core/services/can-load-service.guard';

const routes: Routes = [
  {
    path: '',
    component: DevicemComponent,
    children:[
      {
        path: 'device',
        component: DeviceComponent,
        canActivate: [CanActivateGuard]
      },{
        path: 'addDevice',
        component: AddDeviceComponent,
        canActivate: [CanActivateGuard]
      },{
        path: 'editDevice',
        component: EditDeviceComponent,
        canActivate: [CanActivateGuard]
      }
    ]

  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class DeviceRoutingModule { }
